<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<!-- 
		Replace path to template, title, header and body
		with actual data.
	 -->
<ui:composition template="../template/layout.xhtml">
	<ui:define name="titulo">#{orgDireccaoController.tituloPagina}</ui:define>

	<ui:define name="frConteudo">
		<h:form id="form">
			<!-- 
							<h:outputLabel value="" />
							<h:inputHidden value="#{orgDireccaoController.infoBean.id}" />
							-->
			<h:panelGrid columns="1" border="0" height="100%">

				<!-- bloco de edição -->
				<p:panel header="#{orgDireccaoController.tituloPagina}"
					rendered="#{orgDireccaoController.estadoCrud}">
					<h:panelGrid border="0" columns="2">
						<f:facet name="header">
							<p:messages id="msgErro" />
						</f:facet>

						<h:outputLabel value="#{msg.orgDireccaoCode}" for="code" />
						<h:inputText id="code" label="#{msg.orgDireccaoCode}"
							value="#{orgDireccaoController.infoBean.code}" required="true"
							requiredMessage="#{msg.orgDireccaoCodeRequiredMessage}" />

						<h:outputLabel value="#{msg.orgDireccao}" for="direccao" />
						<h:inputText id="direccao" label="#{msg.orgDireccao}"
							value="#{orgDireccaoController.infoBean.direccao}"
							required="true"
							requiredMessage="#{msg.orgDireccaoRequiredMessage}" />

						<h:outputLabel value="#{msg.orgDireccaoActivo}" for="activo" />
						<h:selectBooleanCheckbox id="activo"
							label="#{msg.orgDireccaoActivo}"
							value="#{orgDireccaoController.infoBean.activo}" />
						<!--
							<h:outputLabel value="#{msg.orgDireccaoDataRegisto}" for="dataRegisto" />
							<h:inputText id="dataRegisto" label="#{msg.orgDireccaoDataRegisto}" value="#{orgDireccaoController.infoBean.dataRegisto}" />
							
							<h:outputLabel value="#{msg.orgDireccaoOperadorRegisto}" for="operadorRegisto" />
							<h:inputText id="operadorRegisto" label="#{msg.orgDireccaoOperadorRegisto}" value="#{orgDireccaoController.infoBean.operadorRegisto}" />
							
							<h:outputLabel value="#{msg.orgDireccaoDataAlteracao}" for="dataAlteracao" />
							<h:inputText id="dataAlteracao" label="#{msg.orgDireccaoDataAlteracao}" value="#{orgDireccaoController.infoBean.dataAlteracao}" />
							
							<h:outputLabel value="#{msg.orgDireccaoOperadorAlteracao}" for="operadorAlteracao" />
							<h:inputText id="operadorAlteracao" label="#{msg.orgDireccaoOperadorAlteracao}" value="#{orgDireccaoController.infoBean.operadorAlteracao}" />
							-->
						<f:facet name="footer">
							<h:panelGroup>
								<center><h:commandButton id="salvarButton"
									value="#{msg.salvarButton}"
									action="#{orgDireccaoController.adicionar}"
									rendered="#{orgDireccaoController.estadoAdicionar}" /> <h:commandButton
									id="alterarButton" value="#{msg.alterarButton}"
									action="#{orgDireccaoController.editar}"
									rendered="#{orgDireccaoController.estadoActualizar}" /> <h:commandButton
									id="eliminarButton" value="#{msg.eliminarButton}"
									action="#{orgDireccaoController.eliminar}"
									rendered="#{orgDireccaoController.estadoEliminar}"
									onclick="if(!confirm('Confirma a exclusão do registo?')) return false;" />
								<h:commandButton id="limparButton" value="#{msg.limparButton}"
									type="reset"
									rendered="#{orgDireccaoController.estadoAdicionar}" /> <h:commandButton
									id="cancelarButton" value="#{msg.cancelarButton}"
									action="#{orgDireccaoController.voltar}" immediate="true" /></center>
							</h:panelGroup>
						</f:facet>
					</h:panelGrid>
				</p:panel>
				<!-- fim do bloco de edição -->
			</h:panelGrid>
			<br />
			<h:panelGroup>
				<h:commandLink action="#{orgDireccaoController.voltar}"
					immediate="true" value="#{msg.geralLinkListaRegistos}" />
				<h:outputText value="  " />
				<h:commandLink action="#{orgDireccaoController.voltar}"
					immediate="true" value="#{msg.geralInicio}" />
			</h:panelGroup>
		</h:form>
	</ui:define>
</ui:composition>
</html>